#include "cubes.h"
#include "ui_cubes.h"
#include "QPainter"
#include "QTimer"
#include "QKeyEvent"

void Cubes::directionLR1()
{
    switch (cDirection)
    {
    case 3:
       /* vCubeRect[j].setLeft(vCubeRect[j].left()-25);
        vCubeRect[vCubeRect.size()-1-j].setRight(vCubeRect[vCubeRect.size()-1-j].right()-25);*/
      //  CubeLeft.setLeft(CubeLeft.left()-25);
       // CubeLeft.setRight(CubeLeft.right()-25);
        CubeLeft = Left(CubeLeft);
        CubeTop = Left(CubeTop);
        CubeRight = Left(CubeRight);
        CubeBottom = Left(CubeBottom);
        timer->start(times);
        break;
    case 4:
       /* vCubeRect[vCubeRect.size()-1-j].setLeft(vCubeRect[vCubeRect.size()-1-j].left()+25);
        vCubeRect[vCubeRect.size()-1-j].setRight(vCubeRect[vCubeRect.size()-1-j].right()+25);*/
        CubeLeft = Right(CubeLeft);
        CubeTop = Right(CubeTop);
        CubeRight = Right(CubeRight);
        CubeBottom = Right(CubeBottom);
        timer->start(times);
        break;
    default:
        if(cDirection!=2&&!blsOver)
            timer->start(times);
  /*  vCubeRect1[vCubeRect1.size()-1-j].setTop(vCubeRect1[vCubeRect1.size()-1-j].top()+25);
    vCubeRect1[vCubeRect1.size()-1-j].setBottom(vCubeRect1[vCubeRect1.size()-1-j].bottom()+25);*/
    }
}

void Cubes::directionLR2()
{
    if(cDirection==3)
    {
        CubeLeft = Right(CubeLeft);
        CubeTop = Right(CubeTop);
        CubeRight = Right(CubeRight);
        CubeBottom = Right(CubeBottom);
    }
    if(cDirection==4)
    {
        CubeLeft = Left(CubeLeft);
        CubeTop = Left(CubeTop);
        CubeRight = Left(CubeRight);
        CubeBottom = Left(CubeBottom);
    }
}

void Cubes::directionD()
{

}
